package com.googlecode.tinyjava;

import com.googlecode.tinyjava.parser.symboltable.Parser;
import com.googlecode.tinyjava.parser.symboltable.Scanner;
import com.googlecode.tinyjava.parser.syntaxtree.SyntaxParser;
import com.googlecode.tinyjava.parser.syntaxtree.SyntaxScanner;

/**
 * TinyJava Compiler.
 * 
 * @author dforster
 */
public class TinyJava {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		if (args.length > 0) {
			Scanner scanner = new Scanner(args[0]);
			Parser parser = new Parser(scanner);

			parser.Parse();
			
			SyntaxScanner scn = new SyntaxScanner(args[0]);
			SyntaxParser prsr = new SyntaxParser(scn);
			
			prsr.symbolTable = parser.symbolTable;
			prsr.Parse();
		} else {
			System.out.println("No source file specified");
		}
	}

}
